import React, { useState } from 'react';
import { Modal ,Breadcrumb,Form,Input,Radio,Select,Button} from 'antd';
import Jurisdiction from './jurisdiction'; 
 

const CreateForm = (props) => {
  const { modalVisible, onCancel } = props;
  const [jurisdictionVisible, setJurisdictionVisible] = useState(false)

  const handleHidden =()=>{
    onCancel()
  }
  const flag =()=>{
    setJurisdictionVisible(false)
  }
  const flagOne=()=>{
    setJurisdictionVisible(true)
  }
  return (
    <>
      <Modal
        destroyOnClose
        visible={modalVisible}
        onCancel={handleHidden}
        footer={null}
        title='新建教师信息'
      >
        <Form 
        title="基础信息" 
         >
          <Form.Item
            name=''
            label='姓名:'
          rules={[{ required: true, message: '姓名必写！' }]}
          >
            <Input/>
          </Form.Item>
          <Form.Item
          name=""
          label="性别"
          rules={[{ required: true, message: '请选择性别！' }]}
          >
          <Radio.Group>
            <Radio value={1}>男</Radio>
            <Radio value={0}>女</Radio>
          </Radio.Group>
        </Form.Item>
        <Form.Item
            name=''
            label='登陆账号:'
          rules={[{ required: true, message: '请输入账号！' }]}
          >
            <Input/>
          </Form.Item>
          <Form.Item
            name=''
            label='登陆密码:'
          rules={[{ required: true, message: '请输入密码！' }]}
          >
            <Input/>
          </Form.Item>
          <Form.Item label="职称" name=""  rules={[{ required: true, message: '职称必选！' }]}> 
            <Select placeholder='点击选择'>
              <Select.Option value="" >全部</Select.Option>
            </Select>
          </Form.Item> 
          <Form.Item
            name=''
            label='工号:'
          rules={[{ required: true, message: '工号必写！' }]}
          >
            <Input/>
          </Form.Item>
          <Form.Item label="所属院(系)" name=""  rules={[{ required: true, message: '所属院系必选！' }]}> 
            <Select placeholder='点击选择'>
              <Select.Option value="" >全部</Select.Option>
            </Select>
          </Form.Item> 
        </Form> 
        <Form
          title='联系信息'
          >  
          <Form.Item
            name=''
            label='手机号:'
          rules={[{ required: true, message: '请输入手机号！' }]}
          >
            <Input/>
          </Form.Item>
          <Form.Item
            name=''
            label='座机号:'
          rules={[{ required: true, message: '请输入座机号！' }]}
          >
            <Input/>
          </Form.Item>
          <Form.Item
            name=''
            label='邮箱:'
          rules={[{required: true, message: '请输入邮箱！'}]}
          >
            <Input/>
          </Form.Item>
          <Form.Item
            name=''
            label='QQ:'
          rules={[{ required: true, message: '请输入QQ号！' }]}
          >
            <Input/>
          </Form.Item>
        </Form>
        <Form 
          title='权限设置'
        >
          <Form.Item
          name=""
          label="是否为指导老师"
          rules={[{ required: true, message: '请选择性别！' }]}
        >
          <Radio.Group>
            <Radio value={1}>是</Radio>
            <Radio value={0}>否</Radio>
          </Radio.Group>
        </Form.Item>
        <Form.Item
          name=""
          label="是否为管理人员"
          rules={[{ required: true, message: '请选择性别！' }]}
        >
          <Radio.Group>
            <Radio value={1}>是</Radio>
            <Radio value={0}>否</Radio>
          </Radio.Group>
            <a
            onClick={flagOne}
            >编辑管理权限</a> 
        </Form.Item> 
        <Form.Item>
          <Button type="primary" htmlType="submit" >
            提交
          </Button>
        </Form.Item> 
        </Form> 
      </Modal>

      <Jurisdiction
      modalVisible={jurisdictionVisible}    
      onCancel={flag}
      />
    </>
  );
};

export default CreateForm;
